#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int num = 0;
    int sum = 0;
    int tmp = 0;
    scanf("%d", &num);
    int i = 0;
    for (i = 0; i < 5; i++)
    {
        tmp = tmp * 10 + num;
        sum += tmp;
    }
    printf("%d\n", sum);
    return 0;
}